#include "include.h"
#include "actions/maincontroller.h"

#include "compile/debug_memoryleaks"
using namespace actions;
using namespace app;
using namespace gui;

MainController::MainController(Root * const _root)
: root(_root),currentActionController(NULL), actionControllerBuilder(NULL)
{
	if (root)
    {
        actionControllerBuilder = new ActionControllerBuilder(root);
    }
}

MainController::~MainController()
{
 if (currentActionController)
    {
        delete currentActionController;
        currentActionController = NULL;
    }
    if (actionControllerBuilder)
    {
        delete actionControllerBuilder;
        actionControllerBuilder = NULL;
    }
}


void MainController::cancelAction()
{
    if (currentActionController)
    {
        delete currentActionController;
        currentActionController = NULL;
    }
}


